<template>
  <div class="home">
    <el-container>
      <!-- 头部 -->
      <el-header>
        <div>
          <img src="../assets/logo.png" alt />
          <span>学生信息管理系统</span>
        </div>
        <!-- <div class="pull-right">
          <span class="welcome">欢迎，{{ nickname }}</span>
          <el-dropdown @command="logout()">
            <el-avatar
              class="avatar-drop"
              :src="require('../assets/avatar.png')"
            >
              <i class="el-icon-arrow-down el-icon--right"></i>
            </el-avatar>

            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item command="a">退出</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </div> -->
        <!-- <el-button type="info" @click="logout">退出</el-button> -->
      </el-header>
      <el-container>
        <el-aside width="200px" style="background-color:#545c64">
          <el-menu
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
          >
            <el-menu-item index="1" @click="openStudentList">
              <i class="el-icon-setting"></i>
              <span slot="title">学生列表</span>
            </el-menu-item>
            <el-menu-item index="2" @click="openScoreList">
              <i class="el-icon-setting"></i>
              <span slot="title">成绩</span>
            </el-menu-item>
          </el-menu>
        </el-aside>
        <el-container>
          <el-main>
            <router-view></router-view>
          </el-main>
          <el-footer>版权所有，侵权必究！</el-footer>
        </el-container>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  name: "Home",
  methods: {
    openStudentList() {
      this.$router.push("/home");
    },
    openScoreList() {
      this.$router.push("/home/score");
    },
  },
};
</script>

<style lang="less" scoped>
.el-container,
.home {
  height: 100%;
}
/* HTML5布局样式 直接对footer元素设置样式 */
.el-footer {
  background: #eaedf1;
  border-top: 1px solid #fff;
  padding: 10px 0 30px 0;
  width: 100%;
  color: #f56c6c;
  font-size: 0.8em;
}
.el-header {
  background-color: #373f41;
  display: flex;
  justify-content: space-between;
  padding-left: 0;
  align-items: center;
  color: #fff;
  font-size: 20px;
  > div {
    display: flex;
    align-items: center;
    img {
      height: 40px;
    }
    span {
      margin-left: 15px;
    }
  }
}
.el-aside {
  background-color: #333744;

  .el-menu {
    border: none;
  }
}
.el-main {
  background-color: #eaedf1;
}
.iconfont {
  margin-right: 10px;
}
.toggle-button {
  background-color: #4a5064;
  font-size: 10px;
  line-height: 24px;
  color: #fff;
  text-align: center;
  letter-spacing: 0.2em;
  // 鼠标放上去变成小手
  cursor: pointer;
}

.avatar-drop {
  margin-right: 15px;
  cursor: pointer;
}

.welcome {
  font-size: 12px;
  color: antiquewhite;
}
</style>
